<section id="compare-classes">
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
                <div id="Bread" class="pull-left">
                    <ol class="breadcrumb">
                        <li><a href="<?php echo SITE_URL; ?>">Home</a></li>
                        <li class="active">Compare</li>
                    </ol>
                </div><!--bread-->
            </div> 
        </div>

        <div class="row">
            <?php
            $seats = 0;
            foreach ($allcompareClasses as $classId) {
                $classcoursedata = explode("@", $classId);
                if (isset($classcoursedata[1]) && $classcoursedata[1] == "class") {
                    $classes = Classes::model()->findByAttributes(array('id' => $classcoursedata[0]));
                       $seats = ClassBatch::seatsAvalableClass($classes);
                    $class_course_title = $classes->class_titile;
                    $getVenues = Classes::getclassWithVenues($classcoursedata[0]);
                    //$locationName = ClassVenue::getLocationNameByVenueId($getVenues);
                    $priceRange = ClassBatch::findMinMaxPriceByClassbatchforCategoryPage($classcoursedata[0]);
                    $imagePath = ($classes->users_id == '') ? 'backend/' . $classes->backend_user_id : $classes->users_id;
                    $imageName = (ClassImage::getPrimaryImage($classcoursedata[0]) != '') ? getRequestbaseUrl() . getuploadFolderDir() . SkillConfig::getClassCourseImagePath($imagePath) . '207X145/' . ClassImage::getPrimaryImage($classcoursedata[0]) : getWorkNoshopimage(SkillConfig::skill_home_category_no_image);
                    $booknow = ($classes->class_type_id !=CURATED_CLASS_TYPE) ? Message::MAKE_QUERY : 'Book Now';
                    $url = $this->createAbsoluteUrl('/workshop-'.$classes->id.'/'.$classes->class_seo_title);
                } else {
                    
                    $classes = Courses::model()->findByAttributes(array('id' => $classcoursedata[0]));
                    $url = $this->createAbsoluteUrl('courses-'.$classes->id.'/'.$classes->course_seo_title);
                    $seats = CourseBatche::seatsAvalableClass($classes);
                    $booknow = ($classes->course_type_id == COURSE_CLASS_TYPE) ? Message::MAKE_QUERY : 'Book Now';
                    $class_course_title = $classes->course_titile;
                    $getVenues = Courses::getCourseWithVenues($classcoursedata[0]);
                    //$locationName = ClassVenue::getLocationNameBycourseVenueId($getVenues);
                    $priceRange = CourseBatche::findMinMaxPriceByClassbatchforCategoryPage($classcoursedata[0]);
                    $imagePath = ($classes->users_id == '') ? 'backend/' . $classes->backend_user_id : $classes->users_id;
                    $imageName = (ClassImage::getCoursesPrimaryImage($classcoursedata[0]) != '') ? getRequestbaseUrl() . getuploadFolderDir() . SkillConfig::getClassCourseImagePath($imagePath) . '207X145/' . ClassImage::getCoursesPrimaryImage($classcoursedata[0]) : getWorkNoshopimage(SkillConfig::skill_home_category_no_image);
                }
                $userType = ($classes->users_id == '') ? 'backend' : '';
                $classTrainerRate = Classes::trainerPossitiverate($userType, $classes);
                $userDetails = ($classes->users_id == '') ? Users::getBackEndUser($classes->backend_user_id) : Users::getFrontEndUser($classes->users_id);
                $trainerResponse = MakeQuery::trainerResponseRate($classes->users_id, $classes->backend_user_id);

                $classTrainerRate = Classes::trainerPossitiverate($userType, $classes);
                ?>


                <div class="compare-division">
                    <div class="thumbnail">
                        <?php echo '<img src="' . $imageName . '"  alt="' . $class_course_title . '" id="' . $classes->id . '">'; ?>
                        <div class="caption">
                            <h4><?php echo substr($class_course_title,0,25); ?></h4>


                            <div class="session">
                                <ul>
                                    <li><p>BY <?php echo substr($userDetails->first_name . '  ' . $userDetails->last_name,0,15); ?></p></li>
                                    <li><p>Rs <?php echo $priceRange; ?></p></li>
                                    <li><p class="txtucase"><?php echo $seats; ?> Seats Left</p></li>
<!--                                    <li><p><?php #echo $locationName; ?></p></li>-->
                                    <li><p>Recommendations <?php echo (!empty($classTrainerRate)) ? $classTrainerRate . '% ' : '0% '; ?> Positive</p></li>
                                    <li><p>Response Rate <?php echo (!empty($trainerResponse) ? $trainerResponse . '%' : TRAINER_RESPONSE_RATE); ?></p></li>
                                </ul>
                            </div>
                        </div>
                        <a href="<?php echo $url; ?>" class="compare-btn"><?php echo $booknow; ?></a>
                    </div>
                </div>
            <?php } ?>   
        </div>
        <div class="gap"></div>
        <div class="gap"></div>
    </div>

</section>


